<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>phpcmsV9 - 后台管理中心</title>
{$system_css} {$system_js}
</head>
<body>
{include file="message.html"}
<div class="pad-10">
  <div class="common-form">
    <form name="myform" action="{$action}" method="post" id="myform">
      <fieldset>
        <legend> 基本信息 </legend>
        <table width="100%" class="table_form">
          <tr>
            <td width="80"> 分类名称 </td>
            <td><input type="text" name="name" value="{$data.name}" class="input-text" id="name"
									size="50">
              </input></td>
          </tr>
          <tr>
            <td> 上级分类 </td>
            <td id="parent_select"> {$category_option} &nbsp; </td>
          </tr>
          <tr>
            <td> 是否显示 </td>
            <td><label style="width:88px">
              <input type="radio" value="1" {if $data.is_show==1 }checked="checked" {/if} name="is_show">
              是 </label>
              <label style="width:88px">
                <input type="radio" value="2" {if $data.is_show==2 }checked="checked" {/if} name="is_show">
                否 </label></td>
          </tr>
          <tr>
            <td> 推荐类型 </td>
            <td> 热门:
              <input type="radio" value="1" name="is_hot" {if $data.is_hot==1 }checked="checked"
									{/if}/>
              是
              <input type="radio" value="0" name="is_hot" {if $data.is_hot==0 }checked="checked"
									{/if}/>
              否 ——推荐：
              <input type="radio" value="1" name="is_best" {if $data.is_best==1 }checked="checked"
									{/if}/>
              是
              <input type="radio" value="0" name="is_best" {if $data.is_best==0 }checked="checked"
									{/if}/>
              否 </td>
          </tr>
          <tr>
            <td> META Title </td>
            <td><input type="text" name="title" value="{$data.title}" class="input-text" size="50">
              </input></td>
          </tr>
          <tr>
            <td> META Keywords </td>
            <td><textarea style="width:50%;height:46px;" name="keywords">
										{$data.keywords}
									</textarea></td>
          </tr>
          <tr>
            <td> META Description </td>
            <td><textarea style="width:50%;height:46px;" name="description">
										{$data.description}
									</textarea></td>
          </tr>
          <tr>
            <td> 排序 </td>
            <td><input type="text" name="position" value="{$data.position}" class="input-text" size="10">
              </input></td>
          </tr>
          <tr align="center">
            <td colspan="2"><input type="submit" value="提交" name="dosubmit" class="button"></td>
          </tr>
        </table>
      </fieldset>
    </form>
  </div>
</div>
<script>
			$(function() {
				$('.parent_id').change(function() {
					$(this).next('.parent_id').remove();
				})
			});

			function change_category(category_sub) {
				$('.parent_id').change(function() {
					$(this).next('.parent_id').remove();
				})
				$.ajax({
					url: "{$site_url}admin/ajax/category_sub",
					type: 'post',
					dataType: 'html',
					data: 'id=' + category_sub.value,
					success: function(data) {
						if (data != '') {
							var html = "<select class='parent_id' name='parent_id[]' onchange='change_category(this)'><option value='0'>==不选择==</option>";
							html += data + "</select>";
							$('#parent_select').append(html);
						} else {
							$(this).next('.parent_id').remove();
						}
					}
				});
			}
		</script>
</body>
</html>